<template>
  <div>
    <h3>孙子组件</h3>
    <p style="color: red">爷爷给的钱：{{ mky }}</p>
    <button @click="changeMky(100)">孙子改爷爷</button>
  </div>
</template>

<script setup>
import { inject } from 'vue'
// 接收数据
const mky = inject('mky')
const changeMky = inject('change-mky')
</script>

<style lang="scss" scoped></style>
